﻿@{
    Layout = "~/Views/Shared/_Root.Head.cshtml";
}
@Html.Widget("body_start_html_tag_after")
@Html.Partial("_Notifications")
@Html.Action("AdminHeaderLinks", "Common")
@Html.Action("JavaScriptDisabledWarning", "Common")

<div id="header">
    @Html.Partial("Header")
</div>
<div id="page">
    @*top menu*@
    @{
        bool showAllCategoryControl = Url.ShowAllCategoryControl();
    }
    <div class="navbar-top-menu navbar navbar-inverse">
        <div class="container navbar-inverse">
            <div class="navbar-header" id="j-category-pop-panel">
                <div class="navbar-header-inner" id="j-allcategory-pop-trigger">
                    All Categories
                    @if (showAllCategoryControl)
                    {
                        <span class="caret"></span>
                    }
                </div>
                @if (showAllCategoryControl)
                {
                    <div id="j-allcategory-pop-content">
                        @*using static category template instead dynamic read category navigation.*@
                        @Html.Partial("~/Views/Catalog/CategoryNavigationStaticTemplate.cshtml")
                    </div>
                    <script type="text/javascript">
                        seajs.use(["common/1.0.0/index", "dropdownbutton/1.0.0/index"], function (app, dropdown) {
                            app(function () {
                                var opts = {
                                    topNav: '#j-category-pop-panel', btnSelector: '#j-allcategory-pop-trigger', listSelector: '#j-allcategory-pop-content', offset: { y: 0, right_x: 0, left_x: -2 }
                                };
                                dropdown.dropDownButton("#j-category-pop-panel", opts);
                            });
                        });
                    </script>
                }
            </div>
            <div class="sep">
                <div class="sep-wrap"></div>
                <span class="triangle"></span>
            </div>
            @Html.Partial("~/Views/Catalog/TopMenuStaticTemplate.cshtml")
            @*@Html.Action("TopMenu", "Catalog")*@
        </div>
    </div>
    @Html.Widget("content_before")
    <div id="page-wrapper" class="container">
        @RenderBody()
    </div>
    @Html.Widget("content_after")
</div>
<div id="footer">
    @Html.Action("Footer", "Common")
</div>
@*@Html.Action("EuCookieLaw", "Common")*@
<script type="text/javascript">
    seajs.use(["common/1.0.0/index", "lazyload/1.0.0/index"], function (app, lazyload) {
        app(function () {
            // initialize shopping cart, false:use notification bar to display information. true: use dialog popup show message
            app.ajaxCart.init(false, '#minicart .cart-qty', '#miniwishlist .wishlist-qty', '#j-flyout-cart');
            lazyload.lazyload("img.lazy", { lazydata: false, threshold: 50, effect: "fadeIn" });
        }); 
    });
    // for form validation.
    seajs.use("jqvalidate/1.0.0/index", function ($) {
        $(function () {
            $("form").validate();
        });
    });
</script>
@Html.Widget("body_end_html_tag_before")
